﻿CREATE PROCEDURE dbo.procCreateLoadedAssembly
	@AssemblyInfoID int,
	@FullName nVarChar(MAX),
	@Location nVarChar(MAX),
	@LoadedAssemblyID int OUTPUT
AS

/****************************************************************************************************
 **        Name: procCreateLoadedAssembly
 ** Description: Creates a new LoadedAssembly record.
 ****************************************************************************************************
 ** Revisions
 **  Date        Author               Work Item  Description
 **  ----------  -------------------  ---------  ----------------------------------------------------
 **  11/30/2008  Chad Green             11774    Initial Development
 **  02/21/2008  Chad Green             11774    Added the @LoadedAssemblyID output parameter and no longer returning the SCOPE_IDENTITY.
 ****************************************************************************************************/

SET @LoadedAssemblyID = 0

BEGIN TRY

	-- Create the new record
	INSERT INTO LoadedAssembly (AssemblyInfoID,
	                            FullName,
	                            Location)
	                    VALUES (@AssemblyInfoID,
	                            @FullName,
	                            @Location)

	-- Return the record identifier
	SET @LoadedAssemblyID = @@IDENTITY

END TRY
BEGIN CATCH
	EXEC procCreateSQLErrorLog
END CATCH
GO

EXEC sp_addextendedproperty @name='MS_Descritpion', @value ='Creates a new LoadedAssembly record.', @level0type = 'SCHEMA', @level0name = 'dbo', @level1type = 'PROCEDURE', @level1name = 'procCreateLoadedAssembly', @level2type = NULL, @level2name = NULL
GO